{% extends 'web/template.html' %}

{% block title %}地铁线路监控系统{% endblock %}

{% block head %}
<style>
    /* 版本号样式 */
    .version {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        color: #999;
        z-index: 100;
    }
    
    @media screen and (max-width: 767px) {
        .version {
            bottom: 65px;
        }
    }

    /* 容器样式 */
    .line-container {
        padding: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* 标题样式 */
    .line-title {
        text-align: center;
        color: #333;
        margin: 30px 0;
        font-size: 24px;
    }

    /* 表格样式 */
    .line-table {
        width: 100%;
        border-collapse: collapse;
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    }

    .line-table th,
    .line-table td {
        padding: 15px;
        text-align: left;
        border-bottom: 1px solid #eee;
    }

    .line-table th {
        background: #f5f5f5;
        font-weight: 500;
        color: #333;
    }

    .line-table tr {
        cursor: pointer;
        transition: all 0.3s;
    }

    .line-table tr:hover {
        background: #f9f9f9;
    }

    .line-table tr:last-child td {
        border-bottom: none;
    }

    /* 状态样式 */
    .status-badge {
        display: inline-flex;
        align-items: center;
        padding: 4px 12px;
        border-radius: 12px;
        background: #e8f5e9;
        color: #4caf50;
        font-size: 13px;
    }

    .status-badge::before {
        content: '';
        width: 6px;
        height: 6px;
        background: currentColor;
        border-radius: 50%;
        margin-right: 6px;
    }

    /* 线路标识 */
    .line-number {
        display: inline-flex;
        align-items: center;
        font-weight: 500;
    }

    .line-indicator {
        display: inline-block;
        width: 4px;
        height: 16px;
        border-radius: 2px;
        margin-right: 8px;
    }

    .line-1 .line-indicator { background: #1E9FFF; }
    .line-2 .line-indicator { background: #5FB878; }
    .line-3 .line-indicator { background: #FFB800; }
    .line-4 .line-indicator { background: #FF2442; }

    /* 移动端适配 */
    @media screen and (max-width: 767px) {
        .line-container {
            padding: 15px;
        }

        .line-table th,
        .line-table td {
            padding: 12px;
        }

        .line-title {
            font-size: 20px;
            margin: 20px 0;
        }
    }

    
</style>
{% endblock %}

{% block content %}
<div class="line-container">
    <h1 class="line-title">身体放松、压力缓解系统</h1>

    <table class="line-table">
        <thead>
            <tr>
                <th>线路</th>
                <th>状态</th>
                <th>更新时间</th>
            </tr>
        </thead>
        <tbody>
            <tr onclick="handleLineClick('/web/line1/index/')" class="line-1">
                <td>
                    <div class="line-number">
                        <span class="line-indicator"></span>
                        1号线
                    </div>
                </td>
                <td><span class="status-badge">运行正常</span></td>
                <td>2024-03-21</td>
            </tr>
            <tr onclick="handleLineClick('/web/line2/index/')" class="line-2">
                <td>
                    <div class="line-number">
                        <span class="line-indicator"></span>
                        2号线
                    </div>
                </td>
                <td><span class="status-badge">运行正常</span></td>
                <td>
                    <script>
                        var now = new Date();
                        var year = now.getFullYear();
                        var month = now.getMonth() + 1;
                        var day = now.getDate();
                        document.write(year + '-' + month + '-' + day);
                    </script>
                </td>
            </tr>
            <tr onclick="handleLineClick('/web/line3/index/')" class="line-3">
                <td>
                    <div class="line-number">
                        <span class="line-indicator"></span>
                        3号线
                    </div>
                </td>
                <td><span class="status-badge">运行正常</span></td>
                <td>
                    <script>
                        var now = new Date();
                        var year = now.getFullYear();
                        var month = now.getMonth() + 1;
                        var day = now.getDate();
                        document.write(year + '-' + month + '-' + day);
                    </script>
                </td>
            </tr>
            <tr onclick="handleLineClick('/web/line4/index/')" class="line-4">
                <td>
                    <div class="line-number">
                        <span class="line-indicator"></span>
                        4号线
                    </div>
                </td>
                <td><span class="status-badge">运行正常</span></td>
                <td>
                    <script>
                        var now = new Date();
                        var year = now.getFullYear();
                        var month = now.getMonth() + 1;
                        var day = now.getDate();
                        document.write(year + '-' + month + '-' + day);
                    </script>
                </td>
            </tr>
        </tbody>
    </table>

   {% include 'web/components/联系方式.html' %}

    <!-- 版本号 -->
    <div class="version">Version 1.0.0</div>
</div>
{% endblock %}

{% block script %}
<script>
    function handleLineClick(lineNumber) {
        // 判断 lineNumber 是否为数字
        if (typeof lineNumber === 'number') {
            layer.msg('该线路正在建设中...', {
                icon: 6,
                time: 2000,
                offset: 't'
            });
        } else {
            window.location.href = lineNumber;
        }
    }


    
</script>
{% endblock %}